<!DOCTYPE html>
<html>
    <head>
        <title>SisPEC</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="resources/css/custom-theme/jquery-ui.css"/>
        <link rel="stylesheet" type="text/css" href="resources/css/ui.css"/>
        <link rel="stylesheet" href="resources/css/nivoSlider/default.css" type="text/css" />
        <link rel="stylesheet" href="resources/css/nivoSlider/nivo-slider.css" type="text/css" />
        <script type="text/javascript" src="resources/js/jquery.min.js"></script>
        <script type="text/javascript" src="resources/js/jquery-ui.min.js"></script>
        <script type="text/javascript" src="resources/js/jquery.jcarousel.min.js"></script>
        <script type="text/javascript" src="resources/js/modulo.js"></script>
        <script type="text/javascript" src="resources/js/EspacoCultural.js"></script>
        <script type="text/javascript" src="resources/js/jquery.json-2.2.min.js"></script>
        <script type="text/javascript" src="resources/js/jquery.tmpl.min.js"></script>
        <script type="text/javascript" src="resources/js/modulo.js"></script>
        <script type="text/javascript" src="resources/js/jquery.nivo.slider.pack.js"></script>
        <script type="text/javascript" src="resources/js/jquery.cookie.js"></script>
        <script type="text/javascript" src="resources/js/jquery.lingua.min.js"></script>
        <script type="text/javascript" src="resources/js/jquery.translate-1.4.7-debug-all.js"></script>
        <script type="text/javascript">
            function reload() {
                var newlanguage = $("#language").val();
                setLanguage(newlanguage);
                updateLanguage(newlanguage);
            }
            
            function updateLanguage(newlanguage) {
                $('.translate').translate( { to: newlanguage, toggle: true} );
                $.linguaLoadAutoUpdate(newlanguage);
            }
            
            function setLanguage(newlanguage) {
                $.cookie("defaultLanguage", newlanguage, {expires: 1});
                $('#language').val(newlanguage);
            }
            
            $(function(){
                try {
                    $("#rodape").load("admin/rodape.html");
                    $("#cabecalho").load("admin/cabecalho.html", function() {
                        var result = $.getUrlVar('id');
                        if(result) {
                            consultarEspaco(result, function() {
                                listarArquivos(result,'slider', 'image', 'imagem', function () {
                                    $('#slider').nivoSlider({effect:"fade"});
                                    /**var newlanguage = null;
                                    $.linguaInit('/sispec/resources/locale/', 'portal');
                                    if($.cookie("defaultLanguage") ==  null || $.cookie("defaultLanguage") == "") {
                                        newlanguage = navigator.language.split('-')[0];
                                        setLanguage(newlanguage);
                                    } else {
                                        newlanguage = $.cookie("defaultLanguage");
                                        $("#language option").each(function() {
                                            if($(this).val() == newlanguage) {
                                                $(this).attr('selected','selected');
                                            }
                                        });
                                    }
                                    updateLanguage(newlanguage);*/
                                }, false);
                            });
                        }
                    });
                } catch(e) {
                    reportCrash(null, e.name, e.stack);
                }
            });
        </script>
    </head>
    <body>
        <div id="outerborder">
            <div id="cabecalho">
            </div>
            <!--<div>
                <select id="language" onchange="reload()">
                    <option value="pt">Português</option>
                    <option value="en">English</option>
                    <option value="de">Deutsch</option>
                </select>
            </div>-->
            <div id="content">
            </div>
            <div id="rodape">
            </div>
        </div>
        <div id="dialogs">
            <div id="message"></div>
        </div>
        <div id="templates">
            <script id="espaco" type="text/x-jquery-tmpl">
                <table style="width: 100%; border-collapse: collapse; padding: 0; border-spacing: 5px;">
                    <tr>
                        <td style="margin-left: 20px;">
                            <div class="ui-widget-content espaco_content">
                                <table style="width: 100%">
                                    <tr>
                                        <td>
                                            <table style="width: 100%">
                                                <tr>
                                                    <td colspan="2">
                                                        <h2 class="translate" style="margin-left: 20px;">
                                                            ${nome}
                                                        </h2>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="vertical-align: top">
                                                        <div style="margin-left: 20px;margin-right: 20px">
                                                            <div style="text-align: justify" class="translate">
                                                                ${descricao}
                                                            </div>
                                                            <h3>Localiza&ccedil;&atilde;o e formas de acesso:</h3>
                                                            <div style="text-align: justify" class="translate">
                                                                ${endereco.logradouro}, ${endereco.complemento} / ${endereco.numero} - ${endereco.estado}
                                                            </div>
                                                            <h3>Para mais informa&ccedil;&otilde;es, entre em contato através dos seguintes meios:</h3>
                                                            <div style="text-align: justify" class="translate">
                                                                <ul>
                                                                    <li>
                                                                        <b class="translate">Tel:</b> ${telefone}
                                                                    </li>
                                                                    <li>
                                                                        <b class="translate">Email:</b> ${email}
                                                                    </li>
                                                                    <li>
                                                                        <b class="translate">Site:</b> ${site}
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                            <h3>Algumas Facilidades do Espa&ccedil;o:</h3>
                                                            <div class="translate">
                                                                <ul id="faclidades">
                                                                </ul>
                                                            </div>
                                                            <br>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td style="width: 610px; vertical-align: top">
                                            <div id="slider-content" class="slider-wrapper theme-default" style="margin-right: 20px; margin-top: 20px; margin-bottom: 20px;">
                                                <div id="slider" class="nivoSlider">
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </script>
            <script id="imagem" type="text/x-jquery-tmpl">
                <img title="${descricao}" alt="${descricao}" src="/sispec/controllers/ArquivoController.php?acao=consultar&cod_arquivo=${cod_arquivo}" style="width:600px; height:400px;"/>
            </script>
            <script id="facilidade" type="text/x-jquery-tmpl">
                <li>${descricao}</li>
            </script>
        </div>
    </body>
</html>